//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;                              struct stuType
{
      char *name;
      float score;
};
stuType student[3];


//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
    student[0].name = "޼";
    student[0].score = 98.8;
    student[1].name = "Ŵɽ";
    student[1].score = 90.0;
    student[2].name = "";
    student[2].score = 79.8;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    int flag = -1;
    if(Edit1->Text==student[0].name)
    {
        Label3->Caption = student[0].score;
        flag = 1;
    }
    if(Edit1->Text==student[1].name)
    {
        Label3->Caption = student[1].score;
        flag = 1;
    }
    if(Edit1->Text==student[2].name)
    {
        Label3->Caption = student[2].score;
        flag = 1;
    }
    if(flag==-1)  Label3->Caption = "ûѧ";
    else Label3->Caption = Label3->Caption + "(ɹѯ)";
}
//---------------------------------------------------------------------------
